
local class = require "class"

local base_type = class()

function base_type:ctor(num)
    self.num = num
    -- print("base ctor")
end

function base_type:ps()
    print(string.format("base type:num:%s", self.num))
end

local test1 = class(base_type)

function test1:ctor(num, name)
    self.name = name
    -- print("test1 ctor")
end

function test1:ps()
    print(string.format("test1: num:%s name:%s", self.num, self.name))
end

local test2 = class(test1)

function test2:ctor(num, name, age)
    self.age = age
    -- print("test2 ctor")
end

function test2:ps()
    print(string.format("test2: num:%s name:%s age:%s", self.num, self.name, self.age))
end

local t2 = test2.new(1, "t2_1", 10)
t2:ps()

